package br.odb.bzk3.midp;

import java.nio.FloatBuffer;

import javax.microedition.lcdui.Graphics;


public class Triangle {
	public float x0;
	public float y0;
	public float x1;
	public float y1;
	public float x2;
	public float y2;
	public float z0;
	public float z1;
	public float z2;
	public float r;
	public float g;
	public float b;
	public float a;
	private FloatBuffer vertexBuffer;



	// ------------------------------------------------------------------------------------------------------------
	public Triangle() {


	}

	public void flatten() {
		z0 = z1 = z2 = -1.2f;
	}
	
	public void init() {

	}

	public void draw( Graphics graphics ) {
		int encoded = (int) b;
		encoded += ( ( int ) g )  << 8;
		encoded += ( ( int ) r ) << 16;
		
		graphics.setColor( encoded );
		graphics.fillTriangle( (int)x0, (int)y0, (int)x1, (int)y1, (int)x2, (int)y2 );
	}
}
